package com.cn.stepLock;

/**
 * @author Aaron
 * @desc
 * @createTime 2022-02-24 19:58
 * @since
 */
public class TestObject {

    private int i;

    private int j;

    public void add(){
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        i++;
        System.out.println("add:"+i);
    }
    public void set(){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        j=i;
        System.out.println("set:"+j);
    }
    public void print(){
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        j++;
        System.out.println("print:"+j);
    }
}
